import Layout from '@/views/Layout/index.vue'
import { component } from 'v-viewer'

const asyncRouter = [
  // ********************管理员用户权限*********************
  // 2.基础数据管理
  {
    path: '/baseData',
    name: 'baseData',
    component: Layout,
    meta: {
      title: '基础数据管理',
      icon: 'DataLine',
      permission: 'baseData'
    },
    children: [
      {
        path: 'collegeInfo',
        meta: {
          title: '院系管理',
          permission: 'baseData:collegeInfo',
          isAdmin: true
        },
        component: () => import('@/views/BaseData/collegeInfo.vue')
      },
      {
        path: 'majorInfo',
        meta: {
          title: '专业管理',
          permission: 'baseData:majorInfo'
        },
        component: () => import('@/views/BaseData/majorInfo.vue')
      },
      {
        path: 'classInfo',
        meta: {
          title: '班级管理',
          permission: 'baseData:classInfo'
        },
        component: () => import('@/views/BaseData/classInfo.vue')
      }
    ]
  },
  // 7.学生管理
  {
    path: '/student',
    name: 'student',
    component: Layout,
    meta: {
      title: '学生用户管理',
      permission: 'student',
      icon: 'Stamp'
    },
    children: [
      {
        path: 'studentList',
        meta: {
          title: '学生用户列表',
          permission: 'student:studentList'
        },
        component: () => import('@/views/Student/studentList.vue')
      }
    ]
  },
  // 5.辅导员管理
  {
    path: '/counsellor',
    name: 'counsellor',
    component: Layout,
    meta: {
      permission: 'counsellor',
      title: '辅导员用户管理'
    },
    children: [
      {
        path: 'counsellorList',
        meta: {
          title: '辅导员用户列表',
          permission: 'counsellor:counsellorList'
        },
        component: () => import('@/views/Counsellor/counsellorList.vue')
      }
    ]
  },
  // 6.企业管理
  {
    path: '/enterprise',
    name: 'enterprise',
    component: Layout,
    meta: {
      permission: 'enterprise',
      icon: 'Search',
      title: '企业用户管理'
    },
    children: [
      {
        path: 'enterpriseList',
        meta: {
          title: '企业用户列表',
          permission: 'enterprise:enterpriseList'
        },
        component: () => import('@/views/Enterprise/enterpriseList.vue')
      },
      {
        path: 'enterpriseLicense',
        meta: {
          title: '电子营业执照审核',
          permission: 'enterprise:license'
        },
        component: () => import('@/views/Enterprise/enterpriseLicense.vue')
      },
      {
        path: 'enterpriseJob',
        meta: {
          title: '企业发布职位审核',
          permission: 'enterprise:job'
        },
        component: () => import('@/views/Enterprise/enterpriseJob.vue')
      }
    ]
  },
  // 4.实习信息管理
  {
    path: '/internship',
    name: 'internship',
    component: Layout,
    meta: {
      permission: 'internship',
      title: '实习信息管理',
      icon: 'Management'
    },
    children: [
      {
        path: 'materialTemplate',
        meta: {
          title: '实习任务下发',
          permission: 'internship:materialTemplate'
        },
        component: () => import('@/views/Internship/materialTemplate.vue')
      },
      {
        path: 'intershipApply',
        meta: {
          title: '实习申请审核',
          permission: 'internship:intershipApply'
        },
        component: () => import('@/views/Internship/intershipApply.vue')
      },
      {
        path: 'internshipInfo',
        meta: {
          title: '学生实习材料审核',
          permission: 'internship:internshipInfo'
        },
        component: () => import('@/views/Internship/internshipInfo.vue')
      },
      {
        path: 'internshipInfoAdmin',
        meta: {
          title: '学生实习材料审核',
          permission: 'internship:internshipInfoAdmin'
        },
        component: () => import('@/views/Internship/internshipInfoAdmin.vue')
      },
      {
        path: 'weeklyJournalManagement',
        meta: {
          title: '学生周记管理',
          permission: 'internship:weeklyJournalManagement'
        },
        component: () => import('@/views/Practice/weeklyJournalManagement.vue')
      },
      {
        path: 'weeklyJournalManagementAdmin',
        meta: {
          title: '学生周记管理',
          permission: 'internship:weeklyJournalManagementAdmin'
        },
        component: () => import('@/views/Practice/weeklyJournalManagementAdmin.vue')
      }
    ]
  },
  // 3.就业信息管理
  {
    path: '/employment',
    name: 'employment',
    component: Layout,
    meta: {
      title: '就业信息管理',
      icon: 'DocumentCopy',
      permission: 'employment'
    },
    children: [
      {
        path: 'employmentMaterials',
        meta: {
          title: '就业任务下发',
          permission: 'employment:employmentMaterials'
        },
        component: () => import('@/views/Employment/employmentMaterials.vue')
      },
      {
        path: 'jobInfo',
        meta: {
          title: '学生就业材料审核',
          permission: 'employment:jobInfo'
        },
        component: () => import('@/views/Employment/jobInfo.vue')
      },
      {
        path: 'jobinfoAdmin',
        meta: {
          title: '就业信息管理',
          permission: 'employment:jobinfoAdmins'
        },
        component: () => import('@/views/Employment/jobinfoAdmin.vue')
      }
    ]
  },

  // ********************企业用户权限*********************
  // 1.职位管理
  {
    path: '/job',
    name: 'job',
    component: Layout,
    meta: {
      title: '职位管理',
      permission: 'job',
      icon: 'Stamp'
    },
    children: [
      {
        path: 'jobList',
        meta: {
          title: '发布职位',
          permission: 'job:jobList'
        },
        component: () => import('@/views/Job/jobList.vue')
      },
      {
        path: 'jobManagement',
        meta: {
          title: '已发布职位管理',
          permission: 'job:management'
        },
        component: () => import('@/views/Job/jobManagement.vue')
      },
      {
        path: 'jobApplyManagement',
        meta: {
          title: '职位申请管理',
          permission: 'job:applyManagement'
        },
        component: () => import('@/views/Job/jobApplyManagement.vue')
      }
    ]
  },
  // 8.状态追踪---管理员和企业共同权限模块
  {
    path: '/track',
    name: 'track',
    component: Layout,
    meta: {
      title: '状态追踪',
      permission: 'track',
      icon: 'Reading'
    },
    children: [
      {
        path: 'interviewRecords',
        meta: {
          title: '面试记录',
          permission: 'track:interviewRecords'
        },
        component: () => import('@/views/StatusTrack/interviewRecords.vue')
      },
      {
        path: 'entryRecord',
        meta: {
          title: '入职记录',
          permission: 'track:entryRecord'
        },
        component: () => import('@/views/StatusTrack/entryRecord.vue')
      },
      {
        path: 'studentStatusTrack',
        meta: {
          title: '学生状态追踪',
          permission: 'track:studentStatusTrack'
        },
        component: () => import('@/views/StatusTrack/index.vue')
      },
      {
        path: 'dataView',
        meta: {
          title: '班级数据查看',
          permission: 'track:dataView'
        },
        component: () => import('@/views/StatusTrack/dataView.vue')
      },
      {
        path: 'dataAnalyse',
        meta: {
          title: '数据分析',
          permission: 'track:dataAnalyse'
        },
        component: () => import('@/views/StatusTrack/dataAnalyse.vue')
      },
      {
        path: 'materialStatus',
        meta: {
          title: '材料追踪',
          permission: 'track:materialStatus'
        },
        component: () => import('@/views/StatusTrack/materialStatus.vue')
      }
    ]
  },

  // ********************学生用户权限*********************
  // 1.职位申请
  {
    path: '/apply',
    name: 'apply',
    component: Layout,
    meta: {
      title: '职位',
      permission: 'apply',
      icon: 'Stamp'
    },
    children: [
      {
        path: 'jobApply',
        meta: {
          title: '职位查看与申请',
          permission: 'apply:jobApply'
        },
        component: () => import('@/views/JobApply/index.vue')
      },
      {
        path: 'jobApplyStatus',
        meta: {
          title: '职位申请状态',
          permission: 'apply:jobApplyStatus'
        },
        component: () => import('@/views/JobApply/jobApplyStatus.vue')
      },
      {
        path: 'onboardingFeedback',
        meta: {
          title: '入职反馈',
          permission: 'apply:onboardingFeedback'
        },
        component: () => import('@/views/JobApply/OnboardingFeedback.vue')
      }
    ]
  },
  // 2.实习汇总
  {
    path: '/practice',
    name: 'practice',
    component: Layout,
    meta: {
      title: '实习汇总',
      permission: 'practice',
      icon: 'Paperclip'
    },
    children: [
      {
        path: 'practiceApply',
        meta: {
          title: '实习申请',
          permission: 'practice:practiceApply'
        },
        component: () => import('@/views/Practice/practiceApply.vue')
      },
      {
        path: 'practiceMaterial',
        meta: {
          title: '实习材料提交',
          permission: 'practice:practiceMaterial'
        },
        component: () => import('@/views/Practice/practiceMaterial.vue')
      },
      {
        path: 'weeklyJournal',
        meta: {
          title: '实习周记管理',
          permission: 'practice:weeklyJournal'
        },
        component: () => import('@/views/Practice/weeklyJournal.vue')
      }
    ]
  },
  // 3.就业汇总
  {
    path: '/employmentSummary',
    name: 'employmentSummary',
    component: Layout,
    meta: {
      title: '就业汇总',
      permission: 'employmentSummary',
      icon: 'Money'
    },
    children: [
      {
        path: 'employmentMaterial',
        meta: {
          title: '就业材料提交',
          permission: 'employmentSummary:employmentMaterial'
        },
        component: () => import('@/views/EmploymentSummary/employmentMaterial.vue')
      }
    ]
  },

  // 辅导员查看学生详情
  {
    path: '/studentDetail/:account/:name',
    name: 'studentDetail',
    hidden: true,
    meta: {
      title: '学生详情',
      icon: 'Money'
    },
    props: true,
    component: () => import('@/views/StatusTrack/studentDetail.vue')
  },
  {
    path: '/weeklyJournalDetail',
    name: 'weeklyJournalDetail',
    hidden: true,
    meta: {
      title: '详情',
      icon: 'Money'
    },
    props: true,
    component: () => import('@/components/common/weeklyJournalDetail.vue')
  },
  // 测试页面
  // {
  //   path: '/test',
  //   name: 'test',
  //   component: Layout,
  //   meta: {
  //     title: '测试页面',
  //     icon: 'Money'
  //   },
  //   children: [
  //     {
  //       path: 'index',
  //       meta: {
  //         title: '测试页面'
  //       },
  //       component: () => import('@/views/Test/index.vue')
  //     },
  //     {
  //       path: 'goeasy',
  //       meta: {
  //         title: 'goeasy测试页面'
  //       },
  //       component: () => import('@/views/Test/goeasy.vue')
  //     }
  //   ]
  // },
  {
    path: '/personal',
    name: 'personal',
    component: Layout,
    meta: {
      title: '个人中心',
      icon: 'Tools'
    },
    children: [
      {
        path: 'userinfo',
        meta: {
          title: '个人信息'
        },
        component: () => import('@/views/Personal/userinfo.vue')
      },
      {
        path: 'password',
        meta: {
          title: '修改密码'
        },
        component: () => import('@/views/Personal/password.vue')
      }
    ]
  }
]

export default asyncRouter
